import request from "@/utils/request";
//引入接口类型
import type { UserInfoListAll } from "./model/userModel";

//定义获取用户信息的接口函数
export const reqGetUserInfo = (page: number, limit: number, keyword: string) => {
  // return request.get<any, UserInfoListAll>(`/admin/user/${page}/${limit}`);
  if (keyword) {
    return request.get<any, UserInfoListAll>(`/admin/user/${page}/${limit}?keyword=${keyword}`);
  } else {
    return request.get<any, UserInfoListAll>(`/admin/user/${page}/${limit}`);
  }
};

//定义点击锁定接口函数
export const reqChangClose = (userId: number, status: number) => {
  return request.get<any, null>(`/admin/user/lock/${userId}/${status}`);
};
